/*
 * Copyright © 2025 上海火金网络科技有限公司. All rights reserved.
 * Product Channel Mapping Data - 从 appconfigs.ts 转换而来的产品渠道映射数据
 *
 * 用途：为 mock 数据和 SQL 数据提供统一的数据源
 * 设计：每个应用的所有产品渠道映射合并为一条记录
 * 版本：1.0.0
 *
 * Website: https://www.anypay.com
 */

// 产品渠道映射配置接口 (每个应用一条记录)
export interface ProductChannelMappingRecord {
  configId: string;           // 配置ID (UCC + 13位时间戳)
  configType: number;         // 配置类型：3=APP_PRODUCT_CHANNEL
  ownerId: string;            // 拥有者ID (应用ID)
  ownerType: number;          // 拥有者类型：2=APPLICATION
  channelCode: null;          // 渠道代码 (此类型不使用，设为NULL)
  productCode: null;          // 产品代码 (此类型不使用，设为NULL)
  connectMode: null;          // 连接模式 (此类型不使用，设为NULL)
  configData: {
    [productCode: string]: {   // 完整的产品渠道映射JSON
      channelCode?: string;    // 渠道代码，undefined表示未配置
      enabled: boolean;        // 是否启用该产品
      extraInfo?: any;         // 额外配置信息
    }
  };
  createdTime: string;
  updatedTime: string;
}

// 从 appconfigs.ts 转换的产品渠道映射数据 (每个应用一条记录)
export const productChannelMappingData: ProductChannelMappingRecord[] = [
  // APP1735689600000 - 华东收银台的完整产品渠道映射
  {
    configId: 'UCC1746866325800',
    configType: 3,
    ownerId: 'APP1735689600000',
    ownerType: 2,
    channelCode: null,
    productCode: null,
    connectMode: null,
    configData: {
      'WXPAY_NATIVE': {
        channelCode: 'CHANNEL_IF_HUIFU',
        enabled: true,
        extraInfo: {
          field1: 'HF202401001',
          field2: 0.55
        }
      },
      'ALIPAY_NATIVE': {
        channelCode: 'CHANNEL_IF_HUIFU',
        enabled: true,
        extraInfo: {
          field1: 'HF202401001',
          field2: 0.52
        }
      },
      'WXPAY_JSAPI': {
        channelCode: 'CHANNEL_IF_FUIOU',
        enabled: true,
        extraInfo: {
          field1: 'FY202401001',
          field2: 0.58
        }
      },
      'WXPAY_H5': {
        channelCode: 'CHANNEL_IF_LESHUA',
        enabled: true,
        extraInfo: {
          field1: 'FY202401001',
          field2: 0.58
        }
      },
      'ALIPAY_H5': {
        channelCode: 'CHANNEL_IF_LESHUA',
        enabled: true,
        extraInfo: {
          field1: 'ALI202401001',
          feeRate: 0.58
        }
      },
      'ALIPAY_JSAPI': {
        channelCode: undefined,
        enabled: false
      },
      'WXPAY_APP': {
        channelCode: undefined,
        enabled: false
      },
      'ALIPAY_APP': {
        channelCode: undefined,
        enabled: false
      }
    },
    createdTime: '2024-01-01 10:00:00',
    updatedTime: '2024-01-15 10:00:00'
  },

  // APP1735689700000 - 惊喜来移动支付的完整产品渠道映射
  {
    configId: 'UCC1746866325801',
    configType: 3,
    ownerId: 'APP1735689700000',
    ownerType: 2,
    channelCode: null,
    productCode: null,
    connectMode: null,
    configData: {
      'WXPAY_APP': {
        channelCode: 'CHANNEL_IF_LESHUA',
        enabled: true,
        extraInfo: {
          field1: 'LS202401002',
          field2: 0.6
        }
      },
      'ALIPAY_APP': {
        channelCode: 'CHANNEL_IF_LESHUA',
        enabled: true,
        extraInfo: {
          field1: 'LS202401002',
          field2: 0.58
        }
      },
      'WXPAY_NATIVE': {
        channelCode: undefined,
        enabled: false
      },
      'ALIPAY_NATIVE': {
        channelCode: undefined,
        enabled: false
      },
      'WXPAY_JSAPI': {
        channelCode: undefined,
        enabled: false
      },
      'ALIPAY_JSAPI': {
        channelCode: undefined,
        enabled: false
      }
    },
    createdTime: '2024-01-02 10:00:00',
    updatedTime: '2024-01-16 10:00:00'
  },

  // APP1735689800000 - 测试网页支付的完整产品渠道映射
  {
    configId: 'UCC1746866325802',
    configType: 3,
    ownerId: 'APP1735689800000',
    ownerType: 2,
    channelCode: null,
    productCode: null,
    connectMode: null,
    configData: {
      'WXPAY_JSAPI': {
        channelCode: 'CHANNEL_IF_WXPAY',
        enabled: true,
        extraInfo: {
          field1: 'WX1900000109',
          field2: 0.6
        }
      },
      'ALIPAY_JSAPI': {
        channelCode: 'CHANNEL_IF_ALIPAY',
        enabled: true,
        extraInfo: {
          field1: 'ALI2088123456789012',
          field2: 0.55
        }
      },
      'WXPAY_H5': {
        channelCode: 'CHANNEL_IF_WXPAY',
        enabled: false,
        extraInfo: {
          field1: 'WX1900000109'
        }
      },
      'WXPAY_NATIVE': {
        channelCode: undefined,
        enabled: false
      },
      'ALIPAY_NATIVE': {
        channelCode: undefined,
        enabled: false
      },
      'WXPAY_APP': {
        channelCode: undefined,
        enabled: false
      },
      'ALIPAY_APP': {
        channelCode: undefined,
        enabled: false
      }
    },
    createdTime: '2024-01-03 10:00:00',
    updatedTime: '2024-01-17 10:00:00'
  }
];

console.log(`✅ 产品渠道映射数据已加载：${productChannelMappingData.length} 条应用记录`);